﻿using Abp.Application.Services;
using Abp.Domain.Repositories;
using Abp.Linq.Extensions;
using AbpVueDemo.System_management.Positionmanager.PositionmanagerDto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbpVueDemo.System_management.Positionmanager
{
    public class PositionDataService : AsyncCrudAppService<PositionmanagerPo, PositionInputDto, int, PagePositionRequestDto, PositionCteateDto, PositionDataUpdateDto>, IPositionDataService
    {
        public PositionDataService(IRepository<PositionmanagerPo, int> repository) : base(repository)
        {
        }
        //职位查询条件
        protected override IQueryable<PositionmanagerPo> CreateFilteredQuery(PagePositionRequestDto input)
        {
            return base.CreateFilteredQuery(input)
                .WhereIf(!string.IsNullOrEmpty(input.p_name), c => c.p_name.Contains(input.p_name))
                 .WhereIf(!string.IsNullOrEmpty(input.p_alias), c => c.p_alias.Contains(input.p_alias))
                 .WhereIf(input.p_id_department>0, c => c.p_id_department==input.p_id_department);
        }
    }
}
